package com.leyou.item.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.leyou.item.dto.SpecParamDTO;
import com.leyou.item.entity.SpecParam;
import com.leyou.item.mapper.SpecParamMapper;
import com.leyou.item.service.SpecParamService;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class SpecParamServiceImpl extends ServiceImpl<SpecParamMapper, SpecParam> implements SpecParamService {
    // 根据条件查询规格参数集合
    @Override
    public List<SpecParamDTO> querySpecParam(Long categoryId, Long groupId, Boolean searching) {
        List<SpecParam> list = query()
                .eq("category_id", categoryId)
                .eq("group_id", groupId)
                .eq("searching", searching)
                .list();
        return SpecParamDTO.convertEntityList(list);
    }


}